/*
swing.h
offer dryer air port swing control motor driver api
designed by lunanting

---------------------------
2020-07-27 15:16:31
create file
---------------------------
*/


#define SWING_ratio 36       //电机减速比
#define SWING_speed 300         //电机运行速度 

#define SWING_io_locker 13  //抱闸

#define SWING_io_limit_top  6  //上限位
#define SWING_io_limit_bottom   7  //下限位


#define SWING_io_touch  0   //触发状态


#include "../../bsp/base_type.h"



/******************************function extern****************************/
extern int xp_swing_init(u8 slave_id);  //init swing
extern int xp_swing_move(int angle);    //swing move angle
extern int xp_swing_debug(char *type,char *fun,char *param);    //swing debug
extern void xp_swing_locker_set(u8 sta);    //swing motor locker
extern int xp_swing_stop(void); //swing stop
extern int xp_swing_check_zero(void);   //check zero
extern void xp_swing_cycle_set(u8 sta);     //swing cycle set
extern void xp_lifter_cycle_set(u8 sta);    //lifter cycle set
extern void xp_swing_topDelay_set(u32 delay);   //set swing top delay time
extern void xp_swing_angle_set(u8 b,u8 t);  //set swing angle
extern void xp_swing_bottom_ignore_set(bool b_ignore);
extern void xp_swing_limit_check(void);     //limit check

//rs57 swing
extern int xp_rs57_swing_init(int port,int speed);  //swing demo init
extern int xp_rs57_swing_recover();   //swing demo recover
extern int xp_rs57_swing_route_set(u8 route);   //swing demo route move 
extern int xp_rs57_swing_move(int angle);   //swing demo move
extern int xp_rs57_swing_checkZero(void);//swing demo checkzero
extern void xp_rs57_swing_cycle_set(u8 sta);//swing demo cycle set

//end of the file
